//
//  UIViewController+tool.m
//  SideDoctor
//
//  Created by 上官惠阳 on 15/9/18.
//  Copyright (c) 2015年 上官惠阳. All rights reserved.
//

#import "UIViewController+tool.h"

@implementation UIViewController (tool)

//相机或相册页面
-(void)createImagePickerControllerWithSourceType:(UIImagePickerControllerSourceType)sourceType
{
    // 跳转到相机或相册页面
    UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
    
    imagePickerController.delegate = self;
    
    imagePickerController.allowsEditing = YES;
    
    imagePickerController.sourceType = sourceType;
    
    //导航栏背景图片
    [imagePickerController.navigationBar setBackgroundImage:[UIImage imageNamed:@"QZNavgationImage.png"] forBarMetrics:UIBarMetricsDefault];
//    imagePickerController.navigationBar.shadowImage = [UIImage imageNamed:@"分割线.png"];
    //导航栏标题颜色
    [imagePickerController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil]];
    //导航栏按钮颜色
    [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
    
    [self presentViewController:imagePickerController animated:YES completion:^{}];
}
@end
